package com.bdqn.crm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.crm.mapper.BasDictMapper;
import com.bdqn.crm.mybatis.ServiceImpl;
import com.bdqn.crm.pojo.BasDict;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.jnlp.BasicService;

@Service
public class BasDictServiceImpl extends ServiceImpl<BasDictMapper, BasDict> implements BasDictService {
    @Resource
    private BasDictMapper basDictMapper;
    @Override
    public IPage<BasDict> page(Long dictId, String dictItem, Page page) {
        return super.getPage(page,new BasDict(dictId,dictItem));
    }

    /**
     * 根据id查询（编辑页面）
     *
     * @param dictId
     * @return
     */
    @Override
    public BasDict selectId(Long dictId) {
        return basDictMapper.selectId(dictId);
    }

    /**
     * 可以用来新增或修改
     *
     * @param basDict
     * @return
     */
    @Override
    public boolean save(BasDict basDict) {
        return super.saveOrUpdate(basDict);
    }
}
